import axios from 'axios';
import router from 'umi/router';
import {message} from 'antd';

function getApiList() {
	return axios.post('/api/subject/list')
}
export default {
	namespace: 'home',
	state: {
		list:[]
	},
	effects: {
		* getList({}, {
			call,
			put
		}) {
			const {count,list} = yield call(getApiList);
			console.log(list)
			yield put({type:'initData',payload:{list}});
		}
	},
	reducers: {
		initData(state,action){
			const {list} = action.payload;
			return {...state,list};
		}
	}
}